package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarInfo;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 我的车辆列表
 * @Auth SongJun
 * @Date 2020/05/21 00:18
 **/
public interface MyCarListCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<List<CarInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onDeleteCarSuccess(BaseModel<Map<String, Object>> successResult);

        void onDeleteCarFailure(BaseModel<Object> failureResult);

    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_MY_CAR_LIST)
        Observable<BaseModel<List<CarInfo>>> getList(@Field("timespan") String timespan);
        @FormUrlEncoded
        @POST(Constants.URL_MY_CAR_DELETE)
        Observable<BaseModel<Map<String, Object>>> deleteCar(@Field("id") String id);
    }

    interface Presenter {
        void getList();
        void deleteCar(String id, int position);
    }

}